package com.hsogoo.collate.batch;

import com.hsogoo.collate.constants.Constant;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.job.flow.FlowExecutionStatus;
import org.springframework.batch.core.job.flow.JobExecutionDecider;

/**
 * @Author huangsaigang
 * Created @2019-11-05.
 */
public class CollateDecider implements JobExecutionDecider {

    @Override
    public FlowExecutionStatus decide(JobExecution jobExecution, StepExecution stepExecution) {
        int executedFlag = 0;
        if(Constant.TASK_EXECUTED == executedFlag){
            return FlowExecutionStatus.STOPPED;
        }else{
            return FlowExecutionStatus.COMPLETED;
        }
    }

}
